package cn.evilcoder;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.util.Arrays;
import java.util.Collection;


/**
 * User: evilcoder
 * Date: 2015/8/23
 * Time: 10:30
 */
@RunWith(Parameterized.class)
public class ParametersTest {

  @Parameterized.Parameters
  public static Collection<Object[]> data(){
    return Arrays.asList(new Object[][]{
        {1,1},{2,4},{3,9},{4,16},{-1,1}
    });
  }

  private int input;
  private int expectOutput;

  public ParametersTest(int input, int expectOutput) {
    this.input = input;
    this.expectOutput = expectOutput;
  }

  @Test
  public void test(){
    Assert.assertEquals(expectOutput,input*input);
  }
}
